package com.cqvip.innocence.project.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.cqvip.innocence.project.model.entity.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.cqvip.innocence.project.model.enums.BusinessType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author Innocence
 * @since 2020-09-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("oper_log")
@ApiModel(value = "OperLog对象", description = "")
public class OperLog extends BaseModel {

    private static final long serialVersionUID = 1L;

    @TableField("admin_id")
    private Long adminId;

    @TableField("admin_name")
    @ApiModelProperty("操作人用户名")
    private String adminName;

    @ApiModelProperty(value = "操作类型")
    @TableField("type")
    private BusinessType type;

    @ApiModelProperty(value = "操作内容")
    @TableField("message")
    private String message;

    @ApiModelProperty(value = "操作结果是否成功(0-正常，1-异常)")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "请求方法")
    @TableField("method")
    private String method;

    @ApiModelProperty(value = "请求方式")
    @TableField("request_method")
    private String requestMethod;

    @ApiModelProperty(value = "请求ip")
    @TableField("ip")
    private String ip;

    @ApiModelProperty(value = "请求参数")
    @TableField("request_param")
    private String requestParam;

    @ApiModelProperty(value = "返回参数")
    @TableField("response_param")
    private String responseParam;

    @ApiModelProperty("错误信息")
    @TableField("error_msg")
    private String errorMsg;

    @TableField(exist = false)
    private LocalDateTime beginTime;

    @TableField(exist = false)
    private LocalDateTime endTime;

}
